package org.dromara.iot.enums;

import lombok.Getter;

/**
 * 保养状态枚举
 */
@Getter
public enum UpKeepEnum {
    /**
     * 待保养
     */
    WAIT_UPKEEP("1", "待保养"),
    /**
     * 待确认
     */
    WAIT_CONFIRM("2", "待确认"),
    /**
     * 已完成
     */
    FINISH("3", "已完成"),
    /**
     * 超期
     */
    OVERDUE("4", "超期");

    private final String code;
    private final String info;

    UpKeepEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public static String getInfo(String code) {
        for (UpKeepEnum value : UpKeepEnum.values()) {
            if (value.code.equals(code)) {
                return value.info;
            }
        }
        return null;
    }
}
